﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TodoApp.ResultModel;
using Volo.Abp.Application.Services;

namespace TodoApp.TMS_SetUp.Positions
{
    public class TMS_PositionService: ApplicationService
    {
        private readonly ITMS_PositionRepositon _tMS_PositionRepositon;
        public TMS_PositionService(ITMS_PositionRepositon tMS_PositionRepositon)
        {
            _tMS_PositionRepositon = tMS_PositionRepositon;
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="tMS_Position"></param>
        /// <returns></returns>
        public async Task<int> CreatePosition(TMS_Position tMS_Position)
        {
            return await _tMS_PositionRepositon.CreatePosition(tMS_Position);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeletePosition(string id)
        {
            return  await _tMS_PositionRepositon.DeletePosition(id);
        }
        /// <summary>
        /// 显示分页
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<TMS_PositionDto>> GetPosition(string name, int pageindex = 1, int pagesize = 5)
        {
            return await _tMS_PositionRepositon.GetPosition(name, pageindex, pagesize);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="tMS_DepartmentDto"></param>
        /// <returns></returns>
        public async Task<int> UpdatePosition(TMS_PositionDto tMS_DepartmentDto)
        {
            return await _tMS_PositionRepositon.UpdatePosition(tMS_DepartmentDto);
        }
    }
}
